﻿<extend name="Base:base"/>
<block name="header"></block>
<block name="footer">
    <script>
        $(document).ready(function () {
            $("#getcode").on("click", function () {
                $.ajax({
                    url: "{$data['root']}/account/code/",
                    type: "POST",
                    data: {
                        number: $("#account").val()
                    },
                    success: function (data) {
                        alert(data);
                    }
                });
            });
            $("#submit").on("click", function () {
                if ($("#password").val() != $("#repassword").val()) {
                    alert("两次密码输入不同");
                    return;
                }
                $.ajax({
                    url: "{$data['root']}/account/ajaxSignup/",
                    type: "POST",
                    dataType: "JSON",
                    data: {
                        account: $("#account").val(),
                        password: $("#password").val(),
                        code: $("#code").val()
                    },
                    success: function (data) {
                        alert(data.message);
                        if (data.code == "1") {
                            window.location.href = "{$data['root']}/";
                        }

                    }
                });
            });
        });
    </script>
</block>
<block name="main">
    <div class="ShareAnyContainer" style="font-size: 14px;">
        当前位置：<a href="{$data['root']}/" title="首页">首页</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a
            href="{$data['root']}/account/signup/" title="注册">注册</a>
    </div>
    <div class="ShareAnySeparate"></div>
    <div class="ShareAnyContainer">
        <div class="line"></div>
    </div>
    <div class="ShareAnySeparate"></div>


    <div class="ShareAnyContainer" style="line-height: 30px; text-align: center;">

        <p>手机号码：<input type="text" id="account"></p>

        <p>
            <button id="getcode">获取验证码</button>
        </p>
        <p>登录密码：<input type="password" id="password"></p>

        <p>确认密码：<input type="repassword" id="repassword"></p>

        <p>验证码：&nbsp;&nbsp;&nbsp;<input type="text" id="code"></p>
<br>
        <p>
            <button id="submit">同意网站会员注册协议并注册</button>
            <br><br><a target="_blank" href="{$data['root']}/account/readme/" title="网站会员注册协议">网站会员注册协议</a>&nbsp;<a
                href="{$data['root']}/account/signupemail/" title="邮箱注册">邮箱注册</a></p>
    </div>
</block>